package com.xx.ems.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * @author xxx
 * @date 2014-2-25
 * @version 1.0
 * 描述: 设备类别表
 */
@Entity
public class Ecategory {
	/**
	 * 描述：主键
	 */
	private Integer cid;
	/**
	 * 描述：类别名称
	 */
	private String cname;
	/**
	 * 描述：设备类型表关联对象
	 */
	private Etypes etypes;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="cid",unique=true,nullable=false)
	public Integer getCid() {
		return cid;
	}
	public void setCid(Integer cid) {
		this.cid = cid;
	}
	@Column(name="cname",length=30,nullable=false)
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	@ManyToOne(targetEntity=Etypes.class)
	@JoinColumn(name="fk_tid")
	public Etypes getEtypes() {
		return etypes;
	}
	public void setEtypes(Etypes etypes) {
		this.etypes = etypes;
	}
}
